LineItems
Batch update line items (max 100). Partial failure allowed.
POST
/
api
/
manager
/
line-items
/
batch-patch
Batch update line items (max 100). Partial failure allowed.
curl --request POST \
--url https://your_a2_service/api/manager/line-items/batch-patch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"budget": 800000,
"id": "<lineitem_id>"
}
]
}
'import requests
url = "https://your_a2_service/api/manager/line-items/batch-patch"
payload = { "items": [
{
"budget": 800000,
"id": "<lineitem_id>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({items: [{budget: 800000, id: '<lineitem_id>'}]})
};
fetch('https://your_a2_service/api/manager/line-items/batch-patch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your_a2_service/api/manager/line-items/batch-patch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'budget' => 800000,
'id' => '<lineitem_id>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your_a2_service/api/manager/line-items/batch-patch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"budget\": 800000,\n \"id\": \"<lineitem_id>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your_a2_service/api/manager/line-items/batch-patch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"budget\": 800000,\n \"id\": \"<lineitem_id>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/manager/line-items/batch-patch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"budget\": 800000,\n \"id\": \"<lineitem_id>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"failed": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reason": "<string>"
}
],
"succeeded": [
{
"budget": 123,
"created_at": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"goal": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"oid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start_date": "2023-11-07T05:31:56Z",
"status": "draft",
"target_cpa": 123,
"updated_at": "2023-11-07T05:31:56Z",
"ad_type": "standard",
"audience_segments": {
"method": "<string>",
"segment_list": [
{
"id": "<string>",
"name": "<string>"
}
]
},
"bid_strategy": "highest_volume",
"creative_rotation": {
"admission_confidence_penalty": 0,
"posterior_temperature": 1,
"prior_weight": 100,
"temperature": 1,
"type": "optimized",
"weights": []
},
"custom_targeting": {
"conditions": [
{
"key": {
"code": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"operator": "in",
"values": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"match_type": "exact"
}
]
}
]
},
"daily_budget": 123,
"description": "<string>",
"ext": "<unknown>",
"max_bid": 0,
"min_daily_imp": 1000,
"no": 123,
"pace_method": "evenly",
"priority": 8,
"schedule": {
"days_of_week": [
1
],
"time_ranges": [
{
"end": "<string>",
"start": "<string>"
}
],
"timezone": "<string>"
},
"sub_goal": "maximize_volume",
"target_cpm": 0,
"target_volume": 0
}
]
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication. Pass the access token in the Authorization: Bearer <token> header.
Body
application/json
Maximum array length:
100Show child attributes
Show child attributes
Was this page helpful?
⌘I
Batch update line items (max 100). Partial failure allowed.
curl --request POST \
--url https://your_a2_service/api/manager/line-items/batch-patch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"budget": 800000,
"id": "<lineitem_id>"
}
]
}
'import requests
url = "https://your_a2_service/api/manager/line-items/batch-patch"
payload = { "items": [
{
"budget": 800000,
"id": "<lineitem_id>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({items: [{budget: 800000, id: '<lineitem_id>'}]})
};
fetch('https://your_a2_service/api/manager/line-items/batch-patch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your_a2_service/api/manager/line-items/batch-patch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'budget' => 800000,
'id' => '<lineitem_id>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your_a2_service/api/manager/line-items/batch-patch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"budget\": 800000,\n \"id\": \"<lineitem_id>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your_a2_service/api/manager/line-items/batch-patch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"budget\": 800000,\n \"id\": \"<lineitem_id>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/manager/line-items/batch-patch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"budget\": 800000,\n \"id\": \"<lineitem_id>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"failed": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reason": "<string>"
}
],
"succeeded": [
{
"budget": 123,
"created_at": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"goal": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"oid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start_date": "2023-11-07T05:31:56Z",
"status": "draft",
"target_cpa": 123,
"updated_at": "2023-11-07T05:31:56Z",
"ad_type": "standard",
"audience_segments": {
"method": "<string>",
"segment_list": [
{
"id": "<string>",
"name": "<string>"
}
]
},
"bid_strategy": "highest_volume",
"creative_rotation": {
"admission_confidence_penalty": 0,
"posterior_temperature": 1,
"prior_weight": 100,
"temperature": 1,
"type": "optimized",
"weights": []
},
"custom_targeting": {
"conditions": [
{
"key": {
"code": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"operator": "in",
"values": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"match_type": "exact"
}
]
}
]
},
"daily_budget": 123,
"description": "<string>",
"ext": "<unknown>",
"max_bid": 0,
"min_daily_imp": 1000,
"no": 123,
"pace_method": "evenly",
"priority": 8,
"schedule": {
"days_of_week": [
1
],
"time_ranges": [
{
"end": "<string>",
"start": "<string>"
}
],
"timezone": "<string>"
},
"sub_goal": "maximize_volume",
"target_cpm": 0,
"target_volume": 0
}
]
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}